package cn.oop.polymorphism;

public class Animal {
    String str;

    public void voice() {
        System.out.println("普通动物叫声!");
    }
}

class Dog extends Animal {
    public void voice() {
        System.out.println("汪汪汪");
    }
}

class Pig extends Animal {
    public void voice() {
        System.out.println("哼哼哼");
    }
}